import request from '@/utils/request'

export function productList(data) {
  return request({
    url: '/productcsy/product/info/productList',
    method: 'post',
    data: data
  })
}


// 新增角色
export function saveOrUpdate(data) {
  return request({
    url: '/productcsy/product/info/saveOrUpdate',
    method: 'post',
    data: data
  })
}

export function brandList(data) {
  return request({
    url: '/productcsy/product/brand/brandList',
    method: 'post',
    data: data
  })
}

export function getAll() {
  return request({
    url: '/productcsy/product/classify/getAll',
    method: 'get'
  })
}

export function typeList() {
  return request({
    url: '/productcsy/product/type/typeList',
    method: 'get'
  })
}

export function getAttrByTyId(productTypeId) {
  return request({
    url: '/productcsy/product/typeAttr/typeAttrList?productTypeId='+productTypeId,
    method: 'get'
  })
}
export function typeParameter(productTypeId) {
  return request({
    url: '/productcsy/product/typeAttr/typeParameterList?productTypeId='+productTypeId,
    method: 'get'
  })
}
export function getProductDetailById(id) {
  return request({
    url: '/productcsy/product/info/getProductDetailById?id='+id,
    method: 'get'
  })
}
